package com.cicc.beergamevirtualsimulationsystem.annotation;

import com.cicc.beergamevirtualsimulationsystem.common.enums.BaseEnum;
import com.cicc.beergamevirtualsimulationsystem.validation.EnumValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.*;

/**
 * 校验是否为 0 1 2 等常量值
 * @author EDY
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Constraint(validatedBy = {EnumValidation.class})//指定提供校验规则的类
public @interface EnumValid {



    String message();

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    Class<? extends BaseEnum> enumClass();
}
